package com.dsteiner.xelavos.client.controller;

import com.dsteiner.widgets.client.event.EventListener;
import com.dsteiner.widgets.client.event.EventManager;
import com.dsteiner.xelavos.client.event.TabSelectionEvent;
import com.dsteiner.xelavos.client.model.MainTabModel;
import com.dsteiner.xelavos.client.model.TabModel;

public class MainTabController {

	private MainTabModel mainTabModel;
	private TabModel comprasTabModel;
	private TabModel trabajoTabModel;
	private TabModel entretenimientoTabModel;
	private TabModel amigosTabModel;
	private TabModel servicesTabModel;

	public void registerMainTabModel(MainTabModel mainTabModel) {
		this.mainTabModel = mainTabModel;
	}

	public void registerComprasTabModel(TabModel comprasTabModel) {
		this.comprasTabModel = comprasTabModel;
	}

	public void registerTrabajoTabModel(TabModel trabajoTabModel) {
		this.trabajoTabModel = trabajoTabModel;
	}

	public void registerEntretenimientoTabModel(TabModel entretenimientoTabModel) {
		this.entretenimientoTabModel = entretenimientoTabModel;
	}

	public void registerAmigosTabModel(TabModel amigosTabModel) {
		this.amigosTabModel = amigosTabModel;
	}

	public void registerServicesTabModel(TabModel servicesTabModel) {
		this.servicesTabModel = servicesTabModel;
	}

	public void registerEventManager(EventManager eventManager) {
		eventManager.registerListener(TabSelectionEvent.class, new EventListener<TabSelectionEvent>() {
			public void onEvent(TabSelectionEvent event) {
				mainTabModel.setSelectedTab(event.getTab());
			}
		});
	}

	
}
